package the.world.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import the.world.bean.User;
import the.world.mapper.UserMapper;
import the.world.service.UserService;

import javax.sql.RowSet;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectByUser(String username, String password) {
        User user = userMapper.selectByUser(username, password);
        if (user != null){
            return user;
        }
        return null;
    }

    @Override
    public int insert(String username,String password) {
        return userMapper.register(username,password);
    }

    @Override
    public User selectById(int uid) {
        return userMapper.selectById(uid);
    }
}
